package cn.heyige.backend.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "批量AI解读请求")
public class BatchAiInterpretRequest {
    
    @NotNull(message = "解读请求列表不能为空")
    @Size(min = 1, max = 10, message = "批量解读数量必须在1-10之间")
    @Valid
    @Schema(description = "解读请求列表")
    private List<SingleInterpretRequest> requests;
    
    @Schema(description = "AI模型", allowableValues = {"WENXIN", "TONGYI", "CHATGPT"}, example = "WENXIN")
    private String aiModel = "WENXIN";
    
    @Schema(description = "解读等级", allowableValues = {"BASIC", "PROFESSIONAL", "MASTER"}, example = "PROFESSIONAL")
    private String interpretationLevel = "PROFESSIONAL";
    
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(description = "单个解读请求")
    public static class SingleInterpretRequest {
        @NotBlank(message = "卦象编码不能为空")
        @Schema(description = "卦象编码", example = "QIAN_WEI_TIAN")
        private String hexagramCode;
        
        @NotBlank(message = "问题不能为空")
        @Size(max = 200, message = "问题不能超过200字符")
        @Schema(description = "问题", example = "事业发展")
        private String question;
        
        @Valid
        @Schema(description = "上下文信息")
        private ContextInfo context;
        
        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Schema(description = "上下文信息")
        public static class ContextInfo {
            @Schema(description = "关注重点", allowableValues = {"CAREER", "FINANCE", "HEALTH", "RELATIONSHIP", "FAMILY"})
            private String focus;
        }
    }
}